#include <iostream>
#include <string>
#include <vector>
using namespace std;
struct X
{
    int val;
    void out(const string &s, int nv)
    {
        cerr << this << "->" << s << ": " << val << " (" << nv << ")" << endl;
    }
    X()
    {
        out("X()", 0);
        val = 0;
    }
    X(int v)
    {
        val = v;
        out("X(int)", v);
    }
    X(const X &x)
    {
        val = x.val;
        out("X(X&)", x.val);
    }
    X &operator=(const X &x)
    {
        out("X::operator=(X&)", x.val);
        val = x.val;
        return *this;
    }
    ~X() { out("~X()", 0); }
};
X glob(2);
X copy(X x) { return x; }
X copy2(X x)
{
    X xx = x;
    return xx;
}
X &ref_to(X &x)
{
    return x;
}
X *make(int v)
{
    X x(v);
    return new X(v);
}
struct XX
{
    X a;
    X b;
};

int main()
{
    X loc(4);
    X loc2(loc);
}